﻿using System.ComponentModel.Composition;

namespace SetVersionNumber.FileWriters {

	/// <summary>
	/// This file writer updates NuGet files.
	/// </summary>
	[Export(typeof(IFileUpdater))]
	public class NuGetFileWriter : RegexBaseVersionNumber {

		/// <summary>
		/// Create a new NuGet file writer
		/// </summary>
		public NuGetFileWriter( )
			: base(@".*\.nuspec$", NUGET_REGEX_STRING) {
			// EMPTY
		}


		/// <summary>
		/// The complete NuGet regular expression text
		/// </summary>
		private const string NUGET_REGEX_STRING = @"<version>\s*(?<"+ VERSION_GROUP_NAME + @">\d+\.\d+(\.\d+)?)\s*</version>";

	}//class

}//namespace
